home *** CD-ROM | disk | FTP | other *** search
Wrap
package { import com.plus9.mockups.InputManager; import com.plus9.mockups.dialogs.BaseDialog; import com.plus9.mockups.ui.OKCancel; import flash.accessibility.*; import flash.data.*; import flash.debugger.*; import flash.desktop.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filesystem.*; import flash.filters.*; import flash.geom.*; import flash.html.*; import flash.html.script.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import mx.binding.*; import mx.containers.ControlBar; import mx.containers.Form; import mx.containers.FormItem; import mx.containers.HBox; import mx.controls.Label; import mx.controls.LinkButton; import mx.controls.Text; import mx.controls.TextInput; import mx.core.UIComponentDescriptor; import mx.core.mx_internal; import mx.events.PropertyChangeEvent; import mx.styles.*; public class Activate extends BaseDialog { public var toDoNext:String; protected var _storageManager:StorageManagerAir; private var _91108202_name:TextInput; private var _1541307179_okCancel:OKCancel; private var _2936224_key:TextInput; private var _981817656_message:Text; private var _documentDescriptor_:UIComponentDescriptor; protected var _1892748927CheckIcon:Class; public function Activate() { _documentDescriptor_ = new UIComponentDescriptor({ "type":BaseDialog, "propertiesFactory":function():Object { return { "height":288, "childDescriptors":[new UIComponentDescriptor({ "type":Text, "id":"_message", "stylesFactory":function():void { this.left = "5"; this.right = "5"; this.top = "5"; }, "propertiesFactory":function():Object { return { "selectable":false, "height":87 }; } }),new UIComponentDescriptor({ "type":Form, "stylesFactory":function():void { this.horizontalCenter = "0"; this.bottom = "0"; }, "propertiesFactory":function():Object { return {"childDescriptors":[new UIComponentDescriptor({ "type":FormItem, "propertiesFactory":function():Object { return { "label":"Your full name:", "childDescriptors":[new UIComponentDescriptor({ "type":HBox, "propertiesFactory":function():Object { return {"childDescriptors":[new UIComponentDescriptor({ "type":TextInput, "id":"_name", "events":{"change":"___name_change"}, "propertiesFactory":function():Object { return {"width":144}; } }),new UIComponentDescriptor({ "type":Label, "propertiesFactory":function():Object { return { "text":"paste it from your email receipt, case sensitive", "width":256 }; } })]}; } })] }; } }),new UIComponentDescriptor({ "type":FormItem, "propertiesFactory":function():Object { return { "label":"Serial Key:", "childDescriptors":[new UIComponentDescriptor({ "type":TextInput, "id":"_key", "events":{"change":"___key_change"}, "propertiesFactory":function():Object { return {"width":380}; } })] }; } }),new UIComponentDescriptor({ "type":FormItem, "propertiesFactory":function():Object { return {"childDescriptors":[new UIComponentDescriptor({ "type":LinkButton, "events":{"click":"___Activate_LinkButton1_click"}, "propertiesFactory":function():Object { return {"label":"where can I find my serial key?"}; } })]}; } })]}; } }),new UIComponentDescriptor({ "type":ControlBar, "stylesFactory":function():void { this.horizontalAlign = "right"; }, "propertiesFactory":function():Object { return { "height":50, "childDescriptors":[new UIComponentDescriptor({ "type":OKCancel, "id":"_okCancel", "events":{ "close":"___okCancel_close", "cancel":"___okCancel_cancel" }, "propertiesFactory":function():Object { return {"okLabel":"Activate"}; } })] }; } })] }; } }); _1892748927CheckIcon = Activate_CheckIcon; super(); mx_internal::_document = this; this.height = 288; this.title = "Product Activation"; } [Bindable(event="propertyChange")] protected function get CheckIcon() : Class { return this._1892748927CheckIcon; } protected function set CheckIcon(param1:Class) : void { var _loc2_:Object = this._1892748927CheckIcon; if(_loc2_ !== param1) { this._1892748927CheckIcon = param1; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"CheckIcon",_loc2_,param1)); } } public function ___okCancel_cancel(param1:Event) : void { onCancel(); } public function ___name_change(param1:Event) : void { updateActivateEnabledState(); } public function set _key(param1:TextInput) : void { var _loc2_:Object = this._2936224_key; if(_loc2_ !== param1) { this._2936224_key = param1; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_key",_loc2_,param1)); } } [Bindable(event="propertyChange")] public function get _message() : Text { return this._981817656_message; } protected function updateActivateEnabledState() : void { var _loc1_:Boolean = _storageManager.isValidKey(_name.text,_key.text); _okCancel.enableOK = _loc1_; _okCancel.okBtn.setStyle("icon",_loc1_ ? CheckIcon : null); if(_okCancel.enableOK) { defaultButton = _okCancel.okBtn; _okCancel.okBtn.setFocus(); } else { defaultButton = _okCancel.cancelBtn; } } public function ___key_change(param1:Event) : void { updateActivateEnabledState(); } override public function init(param1:InputManager) : void { super.init(param1); defaultButton = _okCancel.cancelBtn; _name.setFocus(); _message.text = "This feature is only available to paying customers.\n\nIf you bought a copy of Balsamiq Mockups please enter your full name or organization name and serial key below to activate Mockups For Desktop."; } public function set _name(param1:TextInput) : void { var _loc2_:Object = this._91108202_name; if(_loc2_ !== param1) { this._91108202_name = param1; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_name",_loc2_,param1)); } } [Bindable(event="propertyChange")] public function get _okCancel() : OKCancel { return this._1541307179_okCancel; } override public function initialize() : void { mx_internal::setDocumentDescriptor(_documentDescriptor_); super.initialize(); } [Bindable(event="propertyChange")] public function get _key() : TextInput { return this._2936224_key; } public function ___Activate_LinkButton1_click(param1:MouseEvent) : void { onHelpClick(param1); } public function set storageManager(param1:StorageManagerAir) : void { _storageManager = param1; updateActivateEnabledState(); } [Bindable(event="propertyChange")] public function get _name() : TextInput { return this._91108202_name; } public function ___okCancel_close(param1:Event) : void { onActivate(); } protected function onHelpClick(param1:MouseEvent) : void { navigateToURL(new URLRequest("http://www.balsamiq.com/products/mockups/support")); } public function set _okCancel(param1:OKCancel) : void { var _loc2_:Object = this._1541307179_okCancel; if(_loc2_ !== param1) { this._1541307179_okCancel = param1; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_okCancel",_loc2_,param1)); } } protected function onActivate() : void { _inputManager.dialogIsOpen = false; dispatchEvent(new Event("myActivate")); } public function set _message(param1:Text) : void { var _loc2_:Object = this._981817656_message; if(_loc2_ !== param1) { this._981817656_message = param1; this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_message",_loc2_,param1)); } } } }